package com.xuzz.study.thread.threadpool;

import java.util.concurrent.atomic.AtomicInteger;

public class MyThreadFactory implements ThreadFactory {
    private final AtomicInteger threadNumber = new AtomicInteger(1);

    @Override
    public Thread newThread(Runnable runnable) {

        Thread t = new Thread(runnable,"thread_pool_"+threadNumber.getAndIncrement());
        return t;
    }
}
